<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<div class="index-book-types">
               <ul>
               <li><span class="title">全部书籍分类</span></li>
               </ul>
</div>
<script type="text/javascript">
var navid = getParameter("navid");
$(function(){
    //书籍分类
	request("listType.do","pageIndex=0&pageSize=6&isNotPage=1",function(data){
		for(var i = 0 ; i< data.length; i++){
		    var d = data[i];
			var row = $(' <li><a></a></li>');
			row.find("a").text(d.name);
			row.find("a").attr("id",d.id);
			row.find("a").attr("code",d.code);
			row.find("a").attr("pid",d.pid);
			row.find("a").attr("navid",i);
			row.find("a").attr("href","bookdtypes.do?navid="+i+"&tid="+d.id+"&tcode="+d.code);
			if(i == navid){
			   row.addClass("selected");
			}
			$(".index-book-types ul").append(row);
		}
		
		$(".index-book-types a").mouseenter(function(){
		   var a = $(this);
		   $(".index-book-types a").removeClass("selected");
		   a.addClass("selected");
	    });
	    
	    $(".index-book-types a").mouseleave(function(){
		   $(this).removeClass("selected");
	    });
	});
	
})
</script>